﻿@model CloudClass.ViewModels.NotesViewModel
@{
    Layout.Title = "笔记";
}


<link href="~/Modules/CloudClass/Styles/classpage.css" rel="stylesheet" />
<div class="container topContainer white">
    <div class="row ">
         <div class="span5" style="padding: 5px; margin-left: 0px">
            <img src="@Href("~/Modules/CloudClass/Content/Class/images/class.jpg")" class="imginfo">
        </div>
        <div class="span5">
            <h3>@Model.CourseInfo.CourseName</h3>
            <p>
               
                @for (int i = 0; i < Model.CourseInfo.StarLevel; i++)
                {
                    <i class="icon-star"></i>
                }
                (600份评价)
            </p>
            <p>讲师：@Model.CourseInfo.UserInfo.UserName</p>
            <p>发布者：@Model.Publisher</p>
            <p>分类：@Model.CourseInfo.CourseClassify.ClassifyName</p>
         
            @if (Model.CourseInfo.IsFree == 1)
            {
                <p class="text-left text-info text-medium">免费</p>
            }
            else
            {
                <p class="text-left text-info text-medium">@Model.CourseInfo.Money</p>
            }
            
        </div>
        <div class="span2" style="padding-left: 65px">
            
          
        </div>
        <input type="hidden" id="hdid" value="@Model.CourseInfo.Id"/>
    </div>
    <div class="row" style="margin-left: -1px; margin-bottom: -20px;">
        <div class="navbar">
            <div class="navbar-inner">

                <ul class="nav">
                    <li><a href="~/CloudClass/Class/ClassPage/@Model.CourseInfo.Id">主页</a></li>
                    <li class="active"><a href="~/CloudClass/Class/Note/@Model.CourseInfo.Id">笔记</a></li>
                    <li><a href="~/CloudClass/Class/Talk/@Model.CourseInfo.Id">讨论区</a></li>
                </ul>
                <ul class="nav pull-right">
                    <li><a href="~/CloudClass/Class/Question/@Model.CourseInfo.Id">问答</a></li>

                </ul>
            </div>
        </div>
    </div>
</div>

<div class="container subContainer white">
    <div class="row-fluid  padding10">
        <div class="span2">笔记</div>

        <div class="span2 offset8"><a href="~/CloudClass/Class/AddNote/@Model.CourseInfo.Id"><i class="icon-edit"></i>&nbsp;添加笔记</a></div>
    </div>
</div>
@using (Html.BeginFormAntiForgeryPost(Url.Action("Note", "Class")))
{
    <div class="container subContainer white" style="margin-top: -1px">
        <div class="row-fluid">
            <div class="row-fluid wella" style="margin: 5px;">
                <a class="btn btn-primary btn-mini" rel="0">全部笔记</a>
                @foreach (var lesson in Model.LessonList)
                {
                    <a class="btn btn-mini" rel="@lesson.Id">课时 @lesson.LessonOrder</a>
                }
                <input type="hidden" id="hdlesson" name="@Html.NameOf(m => m.LessonID)" value="@Model.LessonID"/>
                <button type="submit" style="display: none"  id="btnsubmit"/>
                <hr/>
            </div>
            <ul class="nav nav-list" style="margin-top: 5px; margin-bottom: 10px;">

           
          
                @foreach (var notes in Model.NotesAboutList)
                {
                    <li>
                            <div class="row-fluid">
                                <div class="span1 text-center">
                                    <img src="@notes.Notes.UserInfo.UserPhoto"></div>
                                <div class="span9 ">
                                    <p><a>@notes.Notes.UserInfo.UserName</a></p>
                                    <p>
                                        <a>@Html.Raw(@notes.Notes.NotesContent) </a>
                                    </p>
                                    <small>@notes.Notes.PublishTime.ToString("MM-dd HH:mm")</small>&nbsp;&nbsp;<i class="icon-thumbs-up"></i><small>顶(@notes.TopCount)</small>&nbsp;&nbsp;<i class="icon-comment"></i><small>评论(@notes.CommentCount)</small>&nbsp;&nbsp;<i class=" icon-star-empty"></i><small>收藏(@notes.CollectCount)</small>
                                </div>
                                <div class="span2 text-right"><small>课时 @notes.Notes.Lesson.LessonOrder</small>&nbsp;&nbsp;<i class="icon-play"></i>@notes.Notes.VideoTime</div>
                            </div>
                        
                    </li>
                    <li class="divider"></li>
                }
            
            </ul>
            @Display(Model.Pager)
        </div>
    </div>
}
<script>
    $(function () {
        $(".btn-mini").removeClass("btn-primary");
        $(".btn-mini").each(function(e) {
            
            console.log($("#hdlesson").val())
            if ($(this).attr("rel") == $("#hdlesson").val()) {
                $(this).addClass("btn-primary");
                //break;
            }
        });
        $(".btn-mini").live("click", function() {
            $(".btn-mini").removeClass("btn-primary");
            $(this).addClass("btn-primary");
            $("#hdlesson").val($(this).attr("rel"));
            $("#btnsubmit").click();
        });
    })
</script>